Create Variables


  • It is recommended to use the initial to reflect the variable type (e.g., Boolean with b; long integer with L) as a naming convention for variables.

Use the Dictionary

For explanations on dictionary usage, including how to create and Rename Variables see click here....

Create Variables from the Editors

Create variables directlyClosed The orientation components of a vector in space. from the IECClosed International Electrotechnical Commission - A not-for-profit, non-governmental international standards organization that prepares and publishes International Standards for all electrical, electronic and related technologies. 61131-3 editors:

FBDClosed Function block diagram - Describes a function between input variables and output variables. A function is described as a set of elementary blocks. editor

  1. Click the dedicated button
    Add Variable in FBD Editor
  2. Figure 1: Add Variable in FBD Editor

  3. Click a location in the editor (or double-click the variable if it is already created).
  4. Edit the name in the Variable Editor (or select an existing variable within the list which is already filtered according to their relevant data type).
    Define Variable Name in FBD Editor
  5. Figure 2: Define Variable Name in FBD Editor

  6. The KAS-IDEClosed Kollmorgen Automation Suite - Integrated Development Environment automatically checks if the variable already exists. If it is new, you have to:
  7. Figure 3: Define Variable Type in FBD Editor

See FBD Variables for more information.

FFLD editor

  1. Double-click the in or out pins of the functionClosed A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. block
    Add a Variable in the FFLD Editor
  2. Figure 4: Add a Variable in the FFLD Editor

  3. Edit the name (or select an existing variable within the list which is already filtered according to their relevant data type)
    Define a Variable Name in the FFLD Editor
  4. Figure 5: Define a Variable Name in the FFLD Editor

  5. The KASClosed Kollmorgen Automation Suite-IDEClosed Integrated Development Environment - An type of computer software that assists computer programmers in developing software. IDEs normally consist of a source code editor, a compiler and/or interpreter, build-automation tools, and a debugger. automatically checks if the variable already exists. If it is new, you have to:
    • Select its type in the drop-down menu (by default, it is set according to the In or Out data type of the function block)
    • Specify where it is defined
      Define a Variable Type in the FFLD Editor

    Figure 6: Define a Variable Type in the FFLD Editor

Data Types

You can create a variable of available Data Types.

For a list of types, click here...

also see "Arrays" on page 1

Complex Structures

Complex variables are arrays, structures, and instances of function blocks. The following features are allowed for programming:

There is almost no limitation in the amount of complex data declared (theoretically up to 4GB, but practically limited by the memory available in the runtimeClosed In computer science, runtime (or run-time) describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). In KAS, runtime refers to the virtual machine that manage the program written in a computer language while it is running.)

For more explanations on the Structure concept, refer to (➜ # 1, Structure)

Declare the Structure

  1. Right-click in the Dictionary to open the menu.
  2. Select the Add structure command.
    Add a Complex Structure
  3. Figure 8: Add Structure

  4. Right-click on the new structure and select the Rename structure command.
    Rename Complex Structure
  5. Figure 9: Rename Structure

  6. Right-click on the new structure and select the Add variable command.
    Add Variable to a Complex Structure
  7. Figure 10: Add Variable

  8. Expand the new structure.
  9. Double-click on the new nested variable and define its name and type.
  10. Repeat steps 5 and 6 to add all the requested variables.

Create an Instance of the Structure

When finalized, drag-and-drop the structure from the library in the (Project) node to a program.
A new instance is automatically created.

  1. Select the new structure and move it with a drag-and-drop operation to the program declaration in the Dictionary.
    Create an Instance of the Structure
  2. Figure 11: Create an Instance of the Structure

  3. You can also add a variable in the Dictionary with the Add variable command.
    Then double-click on the new variable to define its type by selecting the structure type which is displayed in the Type drop-down menu.
  4. Then you can drag this new instance and drop it in your program like any other variable

Concept Link IconSee Also